package com.linewell.demo;

import com.alibaba.fastjson.JSON;
import com.linewell.pojo.Book;
import com.linewell.util.UUIDUtil;
import org.apache.commons.lang.StringUtils;
import org.junit.Test;

import java.util.*;

/**
 * @Title: IdeaProject
 * @description:
 * @author: hyuhuang@linewell.com
 * @since:2018/10/22
 */
public class test {
    @Test
    public void test(){
       List<Book> list = new ArrayList<>();
       Book book1 = new Book("123","123");
       Book book2 = new Book("124","124");
       Book book3 = new Book("125","124");
       list.add(book1);
       list.add(book2);
       list.add(book3);

       Set set = new HashSet();
       set.add("123");
       list.forEach(book -> {
            if (!set.contains(book.getReader())){
                set.add(book.getReader());
            }
       });

        System.out.println(set.toString());
    }

    @Test
    public  void test1(){



    }


}
